package com.wujing.visti

import com.wujing.visti.VistTest.Clerk.test

object VistTest {
  def main(args: Array[String]): Unit = {
    val clerk = new Clerk
    clerk.showInfo()
    Clerk.test(clerk)
  }

  class Clerk{
    var name:String="jack"
    private var sal:Double=12.1
    def showInfo()={
      println("name"+name+"  sal:"+sal)
    }
  }

  //伴生类  伴生对象
  // 将static 拿掉了,设计了一个 伴生对象和伴生类的
  //  伴生类写非静态的内容 伴生对象就是静态类
  object Clerk{
    def test (clerk: Clerk)={
      println("test()===> name"+clerk.name+",sal==>"+clerk.sal)
    }
  }

}
